﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LIMS.Web
{
    public partial class AdmTeacManange : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) 
            {
                AspNetPager1.RecordCount = BLL.TeacherManager.GetAllTeacher().Count;
                rpTeacher.DataSource = BLL.CommonPager<Model.Teachers>.GetTSourceByPager(BLL.TeacherManager.GetAllTeacher(),
                AspNetPager1.PageSize,1);
                rpTeacher.DataBind();
            }
        }

        protected void btnFind_Click(object sender, EventArgs e)
        {
            rpTeacher.DataSource = BLL.TeacherManager.SearchByName(txtTeacherName.Value.Trim());
            rpTeacher.DataBind();
        }

        protected void btnAddAdmin_Click(object sender, EventArgs e)
        {
            Response.Redirect("./AdminTeacherAdd.aspx");
        }

        protected void rpTeacher_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {

        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            rpTeacher.DataSource = BLL.CommonPager<Model.Teachers>.GetTSourceByPager(BLL.TeacherManager.GetAllTeacher(), 
                AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex);
            rpTeacher.DataBind();
        }

    }
}